
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_a :=make ([]float64 ,len (array ));copy (_a ,array );return _a ;};_af :=len (array )/2;_f :=MergeSort (array [:_af ]);_c :=MergeSort (array [_af :]);_ff :=make ([]float64 ,len (array ));_fc :=0;_d :=0;_fd :=0;for _d < len (_f )&&_fd < len (_c ){if _f [_d ]<=_c [_fd ]{_ff [_fc ]=_f [_d ];_d ++;}else {_ff [_fc ]=_c [_fd ];_fd ++;};_fc ++;};for _d < len (_f ){_ff [_fc ]=_f [_d ];_d ++;_fc ++;};for _fd < len (_c ){_ff [_fc ]=_c [_fd ];_fd ++;_fc ++;};return _ff ;};
